package com.cf.config;

/**
 * 定时任务配置
 *
 */

public class QuartzConfig {
	/*
	 * @Bean public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource)
	 * { SchedulerFactoryBean factory = new SchedulerFactoryBean();
	 * factory.setDataSource(dataSource);
	 * 
	 * // quartz参数 Properties prop = new Properties();
	 * prop.put("org.quartz.scheduler.instanceName", "CfScheduler");
	 * prop.put("org.quartz.scheduler.instanceId", "AUTO"); // 线程池配置
	 * prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
	 * prop.put("org.quartz.threadPool.threadCount", "20");
	 * prop.put("org.quartz.threadPool.threadPriority", "5"); // JobStore配置
	 * prop.put("org.quartz.jobStore.class",
	 * "org.quartz.impl.jdbcjobstore.JobStoreTX"); // 集群配置
	 * prop.put("org.quartz.jobStore.isClustered", "true");
	 * prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000");
	 * prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1");
	 * 
	 * prop.put("org.quartz.jobStore.misfireThreshold", "12000");
	 * prop.put("org.quartz.jobStore.tablePrefix", "CharlieOutQRTZ_");
	 * prop.put("org.quartz.jobStore.selectWithLockSQL",
	 * "SELECT* FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
	 */
	/*
	 * prop.put("org.quartz.jobStore.dataSource", "mssql");
	 * prop.put("org.quartz.dataSource.mssql.driver",
	 * "com.microsoft.sqlserver.jdbc.SQLServerDriver");
	 * prop.put("org.quartz.dataSource.mssql.URL",
	 * "jdbc:sqlserver://127.0.0.1:1433;databasename=JsTest");
	 * prop.put("org.quartz.dataSource.mssql.user", "sa");
	 * prop.put("org.quartz.dataSource.mssql.password", "12345678");
	 * prop.put("org.quartz.dataSource.mssql.maxConnections", 10);
	 */
	/*
	 * factory.setQuartzProperties(prop);
	 * 
	 * factory.setSchedulerName("CfScheduler"); // 延时启动 factory.setStartupDelay(30);
	 * factory.setApplicationContextSchedulerContextKey("applicationContextKey"); //
	 * 可选，QuartzScheduler //
	 * 启动时更新己存在的Job，这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
	 * factory.setOverwriteExistingJobs(true); // 设置自动启动，默认为true //
	 * factory.setAutoStartup(true);
	 * 
	 * return factory;
	 * 
	 * 
	 * }
	 */
}
